package com.cjf.weather.weatherreport.service.impl;

import com.cjf.weather.weatherreport.service.WeatherReportService;
import com.cjf.weather.weatherreport.vo.Forecast;
import com.cjf.weather.weatherreport.vo.Weather;
import com.cjf.weather.weatherreport.vo.WeatherResponse;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cjf
 * @description 天气报道服务
 * @create 2019-03-29 23:44
 */
@Service
public class WeatherReportServiceImpl implements WeatherReportService {

    @Override
    public WeatherResponse reportWeather(String cityId) {
        // TODO 需要调用天气接口
        Weather data = new Weather();
        data.setCity("深圳");
        data.setGanmao("容易感冒！多穿衣");
        data.setWendu("22");

        List<Forecast> forecastList = new ArrayList<>();

        Forecast forecast = new Forecast();
        forecast.setDate("25日星期天");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温 11度");
        forecast.setLow("低温 1度");
        forecastList.add(forecast);

        forecast = new Forecast();
        forecast.setDate("26日星期天");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温 11度");
        forecast.setLow("低温 1度");
        forecastList.add(forecast);

        forecast = new Forecast();
        forecast.setDate("27日星期天");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温 11度");
        forecast.setLow("低温 1度");
        forecastList.add(forecast);

        forecast = new Forecast();
        forecast.setDate("28日星期天");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温 11度");
        forecast.setLow("低温 1度");
        forecastList.add(forecast);

        forecast = new Forecast();
        forecast.setDate("29日星期天");
        forecast.setType("晴");
        forecast.setFengxiang("无风");
        forecast.setHigh("高温 11度");
        forecast.setLow("低温 1度");
        forecastList.add(forecast);

        data.setForecast(forecastList);
        WeatherResponse weatherResponse = new WeatherResponse();
        weatherResponse.setData(data);
        weatherResponse.setDesc("");
        weatherResponse.setStatus(1001);
        return weatherResponse;
    }
}
